<script type="text/javascript" src="<?php echo HOST; ?>/theme/default/js/upload.js"></script>
<script type="text/javascript"> 
	function ajaxFileUpload(){
		$.ajaxFileUpload({
		url:'<?php echo HOST; ?>/api/file_save/small/yes/w/240/h/320/',
		secureuri:false,
		fileElementId:'src',
		dataType: 'text',
		success: function (data, status){
			if(data.indexOf("error")>= 0){
				alert("文件上传失败");
			}else{
				$("#show").val(data);  
				path.value=data;
			}
		},error: function (data, status, e)
			{
				
			}
		});
		}
</script>
<input id="url" value=""/>
<br/>
<input type='file' name='src'id='src'/>
<br/>
<input type="button" value="上传" onclick='ajaxFileUpload()'>